﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;

namespace COFE.Data
{
    public static class IDBEntryListRegistrarExtension
    {
        public static IEntryList GetDBLinkEntryList(this IEntryListRegistrar entryListRegistrar, IUserProfile user, Entry dblinkEntry)
        {
            var entryList = COFEShared.EntryListRegistrar[dblinkEntry.EntryId.ToString()];
            if (entryList == null) //Not created, or removed somehow.                        
                entryList = COFEShared.CurrentUserProfile.EntryListManager.CreateCustomEntryList(dblinkEntry.EntryId.ToString());
            return entryList;
        }
    }
}
